----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  D:\Vicard\VV\re\inprogress\BRV\results\Table3.log
  log type:  text
 opened on:  29 Sep 2017, 17:24:14

. 
. ***************************
. * A - UNCERTAINTY MEASURE *
. ***************************
. 
. ** By country/product hs6 ** 
. 
. use "$Output\dataset_brv_fe", clear

. keep prod country shock_nojkt_trim sigma_sign_nojkt

. g exp_shock_nojkt_trim  = sigma_sign_nojkt*exp(shock_nojkt_trim)
(3,385,328 missing values generated)

. replace shock_nojkt_trim = shock_nojkt_trim*sigma_sign_nojkt
(3,690,049 real changes made)

. collapse (sd) sd_lres_v = shock_nojkt_trim sd_res_v = exp_shock_nojkt_trim , by(country prod)

. sort country prod

. save "$Output\sd_res_jk", replace
(note: file data\output\sd_res_jk.dta not found)
file data\output\sd_res_jk.dta saved

. 
. 
. ***************
. * B - TABLE 3 *
. ***************
. 
. use "$Output\dataset_brv_fe", clear

. 
. global condition  "entry_ele!=1994 & entry_ele!=1995"

. keep if $condition
(2,692,388 observations deleted)

. tsset ijk year 
       panel variable:  ijk (unbalanced)
        time variable:  year, 1996 to 2005, but with gaps
                delta:  1 unit

. 
. sort  country prod

. merge country prod using "$Output\sd_res_jk", nokeep
(note: you are using old merge syntax; see [D] merge for new syntax)
variables country prod do not uniquely identify observations in the master data

. tab  _merge

     _merge |      Freq.     Percent        Cum.
------------+-----------------------------------
          3 |  4,382,989      100.00      100.00
------------+-----------------------------------
      Total |  4,382,989      100.00

. drop _merge

. 
. foreach sd in sd_lres_v{
  2.         rename `sd' sd_jk
  3. 
.         gen diff_sd       = diff*sd_jk
  4.         gen diff_sd_ele1  = diff*sd_jk*age_ele1
  5.         gen age_ele1_sd   = age_ele1*sd_jk
  6. 
.         egen jk = group(prod country)
  7. 
.         egen median_sd_jk = pctile(sd_jk), p(50)
  8.         
. foreach var in diff {
  9. 
.                 eststo: reg dprior `var' age_ele1  sd_jk  `var'_ele1 `var'_sd                                                   if $condition, r cluster(jk)
 10.                 *quantif
.                 sum sd_jk, d
 11.                 scalar sd_mean = r(mean)
 12.                 scalar sd_sd = r(sd)
 13.                 lincom `var'+`var'_sd*sd_mean
 14.                 lincom `var'+`var'_sd*(sd_mean+sd_sd)
 15.                 eststo: reg dprior `var' age_ele1  sd_jk  `var'_ele1 `var'_sd age_ele1_sd `var'_sd_ele1 if $condition, r cluster(jk)
 16.                 eststo: reg dprior `var'  age_ele1 `var'_ele1                                                                                   if sd_jk>median_sd_jk & sd_jk!=., r cluster(jk)
 17.                 eststo: reg dprior `var'  age_ele1 `var'_ele1                                                                                   if sd_jk<median_sd_jk & sd_jk!=., r cluster(jk)
 18. 
.                 set linesize 250
 19.                 esttab, mtitles drop(_cons) b(%5.3f) se(%5.3f) compress r2 starlevels(c 0.1 b 0.05 a 0.01)  se 
 20.                 esttab, mtitles drop(_cons) b(%5.3f) se(%5.3f) r2  starlevels({$^c$} 0.1 {$^b$} 0.05 {$^a$} 0.01) se tex label  title() 
 21.                 eststo clear
 22.                                         
.         }
 23. }
(2,534,863 missing values generated)
(2,534,863 missing values generated)
(243,075 missing values generated)

Linear regression                               Number of obs     =  1,848,126
                                                F(5, 86020)       =    4280.71
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0442
                                                Root MSE          =     1.1727

                                (Std. Err. adjusted for 86,021 clusters in jk)
------------------------------------------------------------------------------
             |               Robust
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        diff |   .1017166   .0059811    17.01   0.000     .0899936    .1134395
    age_ele1 |   -.032716   .0004228   -77.37   0.000    -.0335448   -.0318873
       sd_jk |  -.0035589   .0014231    -2.50   0.012    -.0063482   -.0007696
   diff_ele1 |  -.0031132   .0004812    -6.47   0.000    -.0040563   -.0021702
     diff_sd |  -.0045685    .000906    -5.04   0.000    -.0063442   -.0027928
       _cons |    .157448   .0042352    37.18   0.000     .1491471    .1657489
------------------------------------------------------------------------------
(est1 stored)

                    (sd) shock_nojkt_trim
-------------------------------------------------------------
      Percentiles      Smallest
 1%     .8035471       .0004933
 5%      1.34957       .0004933
10%      1.55294       .0004933       Obs           4,139,914
25%     1.874055       .0004933       Sum of Wgt.   4,139,914

50%     2.262067                      Mean           2.613484
                        Largest       Std. Dev.      1.591042
75%     2.814911       71.27124
90%     3.851399       71.27124       Variance       2.531414
95%     4.994318       71.27124       Skewness       5.549492
99%     9.099094       71.27124       Kurtosis        64.2155

 ( 1)  diff + 2.613484*diff_sd = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0897769   .0036613    24.52   0.000     .0826007     .096953
------------------------------------------------------------------------------

 ( 1)  diff + 4.204526*diff_sd = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0825082   .0022974    35.91   0.000     .0780053    .0870112
------------------------------------------------------------------------------

Linear regression                               Number of obs     =  1,848,126
                                                F(7, 86020)       =    3031.83
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0446
                                                Root MSE          =     1.1725

                                (Std. Err. adjusted for 86,021 clusters in jk)
------------------------------------------------------------------------------
             |               Robust
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        diff |   .1130362   .0047854    23.62   0.000     .1036569    .1224156
    age_ele1 |  -.0273432   .0011493   -23.79   0.000    -.0295959   -.0250906
       sd_jk |    .003963   .0022983     1.72   0.085    -.0005417    .0084676
   diff_ele1 |  -.0062253   .0005922   -10.51   0.000     -.007386   -.0050647
     diff_sd |  -.0064087      .0009    -7.12   0.000    -.0081727   -.0046446
 age_ele1_sd |  -.0021397   .0004094    -5.23   0.000    -.0029421   -.0013373
diff_sd_ele1 |   .0005045   .0001114     4.53   0.000     .0002862    .0007228
       _cons |   .1382913   .0062285    22.20   0.000     .1260834    .1504992
------------------------------------------------------------------------------
(est2 stored)

Linear regression                               Number of obs     =    928,963
                                                F(3, 42348)       =    2058.97
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0299
                                                Root MSE          =     1.1998

                                (Std. Err. adjusted for 42,349 clusters in jk)
------------------------------------------------------------------------------
             |               Robust
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        diff |   .0535934   .0014177    37.80   0.000     .0508147     .056372
    age_ele1 |  -.0368899   .0005834   -63.24   0.000    -.0380333   -.0357465
   diff_ele1 |  -.0023312   .0002643    -8.82   0.000    -.0028492   -.0018132
       _cons |   .1608091   .0025938    62.00   0.000     .1557251     .165893
------------------------------------------------------------------------------
(est3 stored)

Linear regression                               Number of obs     =    919,146
                                                F(3, 43670)       =    5572.18
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0680
                                                Root MSE          =     1.1397

                                (Std. Err. adjusted for 43,671 clusters in jk)
------------------------------------------------------------------------------
             |               Robust
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        diff |   .1625603    .001745    93.16   0.000     .1591402    .1659804
    age_ele1 |  -.0279749   .0005724   -48.87   0.000    -.0290968   -.0268529
   diff_ele1 |  -.0071212   .0004235   -16.82   0.000    -.0079512   -.0062912
       _cons |   .1389607    .002625    52.94   0.000     .1338158    .1441057
------------------------------------------------------------------------------
(est4 stored)

------------------------------------------------------
                 (1)        (2)        (3)        (4) 
                est1       est2       est3       est4 
------------------------------------------------------
diff           0.102a     0.113a     0.054a     0.163a
             (0.006)    (0.005)    (0.001)    (0.002) 

age_ele1      -0.033a    -0.027a    -0.037a    -0.028a
             (0.000)    (0.001)    (0.001)    (0.001) 

sd_jk         -0.004b     0.004c                      
             (0.001)    (0.002)                       

diff_ele1     -0.003a    -0.006a    -0.002a    -0.007a
             (0.000)    (0.001)    (0.000)    (0.000) 

diff_sd       -0.005a    -0.006a                      
             (0.001)    (0.001)                       

age_ele1~d               -0.002a                      
                        (0.000)                       

diff_sd_~1                0.001a                      
                        (0.000)                       
------------------------------------------------------
N            1848126    1848126     928963     919146 
R-sq           0.044      0.045      0.030      0.068 
------------------------------------------------------
Standard errors in parentheses
c p<0.1, b p<0.05, a p<0.01

{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{4}{c}}
\hline\hline
                    &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\
                    &\multicolumn{1}{c}{est1}&\multicolumn{1}{c}{est2}&\multicolumn{1}{c}{est3}&\multicolumn{1}{c}{est4}\\
\hline
$\widehat{a}\_{ijkt}-\varepsilon^q\_{ijk,t-1}$&       0.102{$^a$}&       0.113{$^a$}&       0.054{$^a$}&       0.163{$^a$}\\
                    &     (0.006)      &     (0.005)      &     (0.001)      &     (0.002)      \\
[1em]
Age$ \_{ijkt}$       &      -0.033{$^a$}&      -0.027{$^a$}&      -0.037{$^a$}&      -0.028{$^a$}\\
                    &     (0.000)      &     (0.001)      &     (0.001)      &     (0.001)      \\
[1em]
(sd) shock\_nojkt\_trim&      -0.004{$^b$}&       0.004{$^c$}&                  &                  \\
                    &     (0.001)      &     (0.002)      &                  &                  \\
[1em]
\hspace{1cm} $\times$ Age$ \_{ijkt}$&      -0.003{$^a$}&      -0.006{$^a$}&      -0.002{$^a$}&      -0.007{$^a$}\\
                    &     (0.000)      &     (0.001)      &     (0.000)      &     (0.000)      \\
[1em]
diff\_sd             &      -0.005{$^a$}&      -0.006{$^a$}&                  &                  \\
                    &     (0.001)      &     (0.001)      &                  &                  \\
[1em]
age\_ele1\_sd         &                  &      -0.002{$^a$}&                  &                  \\
                    &                  &     (0.000)      &                  &                  \\
[1em]
diff\_sd\_ele1        &                  &       0.001{$^a$}&                  &                  \\
                    &                  &     (0.000)      &                  &                  \\
\hline
Observations        &     1848126      &     1848126      &      928963      &      919146      \\
\(R^{2}\)           &       0.044      &       0.045      &       0.030      &       0.068      \\
\hline\hline
\multicolumn{5}{l}{\footnotesize Standard errors in parentheses}\\
\multicolumn{5}{l}{\footnotesize {$^c$} p<0.1, {$^b$} p<0.05, {$^a$} p<0.01}\\
\end{tabular}
}

. 
.         
. *********************************
. * B - FIGURE A.4 (web appendix) *
. *********************************
. 
. use "$Output\dataset_brv_fe", clear

. 
. global condition  "entry_ele!=1994 & entry_ele!=1995"

. keep if $condition
(2,692,388 observations deleted)

. 
. sort  country prod

. merge country prod using "$Output\sd_res_jk", nokeep
(note: you are using old merge syntax; see [D] merge for new syntax)
variables country prod do not uniquely identify observations in the master data

. tab  _merge

     _merge |      Freq.     Percent        Cum.
------------+-----------------------------------
          3 |  4,382,989      100.00      100.00
------------+-----------------------------------
      Total |  4,382,989      100.00

. drop _merge

. 
. rename sd_lres_v sd_jk

. 
. gen diff_sd     = diff*sd_jk
(2,534,863 missing values generated)

. gen diff_sd_ele1  = diff*sd_jk*age_ele1
(2,534,863 missing values generated)

. 
. gen age_ele1_sd                         = age_ele1*sd_jk
(243,075 missing values generated)

. 
. egen median_sd_jk = pctile(sd_jk), p(50)

. egen p25_sd_jk = pctile(sd_jk), p(25)

. egen p75_sd_jk = pctile(sd_jk), p(75)

. 
. egen jk = group(prod country)

. *
. eststo: reg dprior diff_ele1_2-diff_ele1_10 ele1_*                                                                                                      if $condition & sd_jk>p75_sd_jk & sd_jk!=., r cluster(jk)
note: ele1_1 omitted because of collinearity
note: ele1_9 omitted because of collinearity

Linear regression                               Number of obs     =    454,040
                                                F(17, 26367)      =     236.02
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0261
                                                Root MSE          =     1.2003

                                (Std. Err. adjusted for 26,368 clusters in jk)
------------------------------------------------------------------------------
             |               Robust
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 diff_ele1_2 |     .03471   .0010439    33.25   0.000     .0326638    .0367561
 diff_ele1_3 |   .0318269    .001289    24.69   0.000     .0293003    .0343534
 diff_ele1_4 |   .0282724   .0014608    19.35   0.000      .025409    .0311357
 diff_ele1_5 |   .0277717   .0016788    16.54   0.000     .0244812    .0310622
 diff_ele1_6 |   .0307041   .0018297    16.78   0.000     .0271178    .0342903
 diff_ele1_7 |   .0264324   .0023618    11.19   0.000     .0218032    .0310617
 diff_ele1_8 |   .0271535   .0025938    10.47   0.000     .0220695    .0322375
 diff_ele1_9 |   .0234774   .0037618     6.24   0.000      .016104    .0308508
diff_ele1_10 |   .0205196   .0060756     3.38   0.001     .0086111    .0324281
      ele1_1 |          0  (omitted)
      ele1_2 |   .1912118   .0137681    13.89   0.000     .1642256    .2181981
      ele1_3 |   .0375077   .0138541     2.71   0.007     .0103529    .0646624
      ele1_4 |   .0089597    .014196     0.63   0.528    -.0188653    .0367847
      ele1_5 |   -.000228   .0145458    -0.02   0.987    -.0287386    .0282826
      ele1_6 |  -.0151091   .0150487    -1.00   0.315    -.0446053    .0143871
      ele1_7 |  -.0060117   .0160836    -0.37   0.709    -.0375365     .025513
      ele1_8 |  -.0149837   .0186585    -0.80   0.422    -.0515554     .021588
      ele1_9 |          0  (omitted)
     ele1_10 |   .0040495   .0250885     0.16   0.872    -.0451254    .0532244
       _cons |   -.055828   .0134413    -4.15   0.000    -.0821737   -.0294823
------------------------------------------------------------------------------
(est1 stored)

. 
. forvalues x=2(1)10{
  2.         lincom diff_ele1_`x'
  3.         g beta_age_high_`x' = r(estimate)
  4.         g se_age_high_`x'   = r(se) 
  5. }

 ( 1)  diff_ele1_2 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |     .03471   .0010439    33.25   0.000     .0326638    .0367561
------------------------------------------------------------------------------

 ( 1)  diff_ele1_3 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0318269    .001289    24.69   0.000     .0293003    .0343534
------------------------------------------------------------------------------

 ( 1)  diff_ele1_4 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0282724   .0014608    19.35   0.000      .025409    .0311357
------------------------------------------------------------------------------

 ( 1)  diff_ele1_5 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0277717   .0016788    16.54   0.000     .0244812    .0310622
------------------------------------------------------------------------------

 ( 1)  diff_ele1_6 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0307041   .0018297    16.78   0.000     .0271178    .0342903
------------------------------------------------------------------------------

 ( 1)  diff_ele1_7 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0264324   .0023618    11.19   0.000     .0218032    .0310617
------------------------------------------------------------------------------

 ( 1)  diff_ele1_8 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0271535   .0025938    10.47   0.000     .0220695    .0322375
------------------------------------------------------------------------------

 ( 1)  diff_ele1_9 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0234774   .0037618     6.24   0.000      .016104    .0308508
------------------------------------------------------------------------------

 ( 1)  diff_ele1_10 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0205196   .0060756     3.38   0.001     .0086111    .0324281
------------------------------------------------------------------------------

. 
. eststo: reg dprior diff_ele1_2-diff_ele1_10 ele1_*                                                                                                      if $condition & sd_jk<p25_sd_jk & sd_jk!=., r cluster(jk)
note: ele1_1 omitted because of collinearity
note: ele1_10 omitted because of collinearity

Linear regression                               Number of obs     =    438,324
                                                F(17, 29412)      =     533.74
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0732
                                                Root MSE          =     1.1139

                                (Std. Err. adjusted for 29,413 clusters in jk)
------------------------------------------------------------------------------
             |               Robust
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 diff_ele1_2 |    .170769   .0021503    79.42   0.000     .1665544    .1749836
 diff_ele1_3 |    .152585   .0027991    54.51   0.000     .1470987    .1580714
 diff_ele1_4 |   .1519424   .0035234    43.12   0.000     .1450365    .1588484
 diff_ele1_5 |   .1495176    .004321    34.60   0.000     .1410484    .1579869
 diff_ele1_6 |   .1420644   .0050545    28.11   0.000     .1321573    .1519714
 diff_ele1_7 |   .1308979   .0058926    22.21   0.000     .1193481    .1424478
 diff_ele1_8 |   .1359065   .0088338    15.38   0.000     .1185919    .1532211
 diff_ele1_9 |   .1307231   .0100071    13.06   0.000     .1111088    .1503373
diff_ele1_10 |   .1280889   .0132223     9.69   0.000     .1021725    .1540053
      ele1_1 |          0  (omitted)
      ele1_2 |   .1497476   .0186172     8.04   0.000     .1132571    .1862382
      ele1_3 |    .052865   .0187173     2.82   0.005     .0161782    .0895517
      ele1_4 |   .0406525   .0187528     2.17   0.030     .0038961    .0774089
      ele1_5 |   .0296383   .0193478     1.53   0.126    -.0082842    .0675608
      ele1_6 |    .029241   .0193301     1.51   0.130    -.0086469    .0671289
      ele1_7 |   .0359221   .0196694     1.83   0.068    -.0026308    .0744751
      ele1_8 |    .033687   .0209246     1.61   0.107    -.0073261    .0747002
      ele1_9 |   .0368046   .0242039     1.52   0.128    -.0106361    .0842453
     ele1_10 |          0  (omitted)
       _cons |  -.0476794    .018469    -2.58   0.010    -.0838796   -.0114793
------------------------------------------------------------------------------
(est2 stored)

. 
. set linesize 250

. esttab, mtitles drop(_cons) b(%5.3f) se(%5.3f) compress r2 starlevels(c 0.1 b 0.05 a 0.01)  se 

--------------------------------
                 (1)        (2) 
                est1       est2 
--------------------------------
diff_ele~2     0.035a     0.171a
             (0.001)    (0.002) 

diff_ele~3     0.032a     0.153a
             (0.001)    (0.003) 

diff_ele~4     0.028a     0.152a
             (0.001)    (0.004) 

diff_ele~5     0.028a     0.150a
             (0.002)    (0.004) 

diff_ele~6     0.031a     0.142a
             (0.002)    (0.005) 

diff_ele~7     0.026a     0.131a
             (0.002)    (0.006) 

diff_ele~8     0.027a     0.136a
             (0.003)    (0.009) 

diff_ele~9     0.023a     0.131a
             (0.004)    (0.010) 

diff_el~10     0.021a     0.128a
             (0.006)    (0.013) 

ele1_1         0.000      0.000 
                 (.)        (.) 

ele1_2         0.191a     0.150a
             (0.014)    (0.019) 

ele1_3         0.038a     0.053a
             (0.014)    (0.019) 

ele1_4         0.009      0.041b
             (0.014)    (0.019) 

ele1_5        -0.000      0.030 
             (0.015)    (0.019) 

ele1_6        -0.015      0.029 
             (0.015)    (0.019) 

ele1_7        -0.006      0.036c
             (0.016)    (0.020) 

ele1_8        -0.015      0.034 
             (0.019)    (0.021) 

ele1_9         0.000      0.037 
                 (.)    (0.024) 

ele1_10        0.004      0.000 
             (0.025)        (.) 
--------------------------------
N             454040     438324 
R-sq           0.026      0.073 
--------------------------------
Standard errors in parentheses
c p<0.1, b p<0.05, a p<0.01

. esttab, mtitles drop(_cons) b(%5.3f) se(%5.3f) r2  starlevels({$^c$} 0.1 {$^b$} 0.05 {$^a$} 0.01) se tex label  title() 

{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{2}{c}}
\hline\hline
                    &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
                    &\multicolumn{1}{c}{est1}&\multicolumn{1}{c}{est2}\\
\hline
\hspace{1cm} $\times$ Age$ \_{ijkt}=2$&       0.035{$^a$}&       0.171{$^a$}\\
                    &     (0.001)      &     (0.002)      \\
[1em]
\hspace{1cm} $\times$ Age$ \_{ijkt}=3$&       0.032{$^a$}&       0.153{$^a$}\\
                    &     (0.001)      &     (0.003)      \\
[1em]
\hspace{1cm} $\times$ Age$ \_{ijkt}=4$&       0.028{$^a$}&       0.152{$^a$}\\
                    &     (0.001)      &     (0.004)      \\
[1em]
\hspace{1cm} $\times$ Age$ \_{ijkt}=5$&       0.028{$^a$}&       0.150{$^a$}\\
                    &     (0.002)      &     (0.004)      \\
[1em]
\hspace{1cm} $\times$ Age$ \_{ijkt}=6$&       0.031{$^a$}&       0.142{$^a$}\\
                    &     (0.002)      &     (0.005)      \\
[1em]
\hspace{1cm} $\times$ Age$ \_{ijkt}=7$&       0.026{$^a$}&       0.131{$^a$}\\
                    &     (0.002)      &     (0.006)      \\
[1em]
\hspace{1cm} $\times$ Age$ \_{ijkt}=8$&       0.027{$^a$}&       0.136{$^a$}\\
                    &     (0.003)      &     (0.009)      \\
[1em]
\hspace{1cm} $\times$ Age$ \_{ijkt}=9$&       0.023{$^a$}&       0.131{$^a$}\\
                    &     (0.004)      &     (0.010)      \\
[1em]
\hspace{1cm} $\times$ Age$ \_{ijkt}=10$&       0.021{$^a$}&       0.128{$^a$}\\
                    &     (0.006)      &     (0.013)      \\
[1em]
Age dummy, 1 years  &       0.000      &       0.000      \\
                    &         (.)      &         (.)      \\
[1em]
Age dummy, 2 years  &       0.191{$^a$}&       0.150{$^a$}\\
                    &     (0.014)      &     (0.019)      \\
[1em]
Age dummy, 3 years  &       0.038{$^a$}&       0.053{$^a$}\\
                    &     (0.014)      &     (0.019)      \\
[1em]
Age dummy, 4 years  &       0.009      &       0.041{$^b$}\\
                    &     (0.014)      &     (0.019)      \\
[1em]
Age dummy, 5 years  &      -0.000      &       0.030      \\
                    &     (0.015)      &     (0.019)      \\
[1em]
Age dummy, 6 years  &      -0.015      &       0.029      \\
                    &     (0.015)      &     (0.019)      \\
[1em]
Age dummy, 7 years  &      -0.006      &       0.036{$^c$}\\
                    &     (0.016)      &     (0.020)      \\
[1em]
Age dummy, 8 years  &      -0.015      &       0.034      \\
                    &     (0.019)      &     (0.021)      \\
[1em]
Age dummy, 9 years  &       0.000      &       0.037      \\
                    &         (.)      &     (0.024)      \\
[1em]
Age dummy, 10 years &       0.004      &       0.000      \\
                    &     (0.025)      &         (.)      \\
\hline
Observations        &      454040      &      438324      \\
\(R^{2}\)           &       0.026      &       0.073      \\
\hline\hline
\multicolumn{3}{l}{\footnotesize Standard errors in parentheses}\\
\multicolumn{3}{l}{\footnotesize {$^c$} p<0.1, {$^b$} p<0.05, {$^a$} p<0.01}\\
\end{tabular}
}

. eststo clear

. 
. forvalues x=2(1)10{
  2.         lincom diff_ele1_`x'
  3.         g beta_age_low_`x' = r(estimate) 
  4.         g se_age_low_`x'   = r(se) 
  5. }

 ( 1)  diff_ele1_2 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |    .170769   .0021503    79.42   0.000     .1665544    .1749836
------------------------------------------------------------------------------

 ( 1)  diff_ele1_3 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |    .152585   .0027991    54.51   0.000     .1470987    .1580714
------------------------------------------------------------------------------

 ( 1)  diff_ele1_4 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .1519424   .0035234    43.12   0.000     .1450365    .1588484
------------------------------------------------------------------------------

 ( 1)  diff_ele1_5 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .1495176    .004321    34.60   0.000     .1410484    .1579869
------------------------------------------------------------------------------

 ( 1)  diff_ele1_6 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .1420644   .0050545    28.11   0.000     .1321573    .1519714
------------------------------------------------------------------------------

 ( 1)  diff_ele1_7 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .1308979   .0058926    22.21   0.000     .1193481    .1424478
------------------------------------------------------------------------------

 ( 1)  diff_ele1_8 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .1359065   .0088338    15.38   0.000     .1185919    .1532211
------------------------------------------------------------------------------

 ( 1)  diff_ele1_9 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .1307231   .0100071    13.06   0.000     .1111088    .1503373
------------------------------------------------------------------------------

 ( 1)  diff_ele1_10 = 0

------------------------------------------------------------------------------
      dprior |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .1280889   .0132223     9.69   0.000     .1021725    .1540053
------------------------------------------------------------------------------

. 
. keep if _n == 1
(4,382,988 observations deleted)

. 
. collapse (max) beta_age_* se_age_*, by(age_ele1)

. 
. g obs = 1

. reshape long beta_age_high_ beta_age_low_ se_age_high_ se_age_low_, i(obs) j(experience)
(note: j = 2 3 4 5 6 7 8 9 10)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                        1   ->       9
Number of variables                  38   ->       7
j variable (9 values)                     ->   experience
xij variables:
beta_age_high_2 beta_age_high_3 ... beta_age_high_10->beta_age_high_
beta_age_low_2 beta_age_low_3 ... beta_age_low_10->beta_age_low_
se_age_high_2 se_age_high_3 ... se_age_high_10->se_age_high_
se_age_low_2 se_age_low_3 ... se_age_low_10->  se_age_low_
-----------------------------------------------------------------------------

. drop age_ele1

. rename  beta_age_high_ beta_age_high

. rename  beta_age_low_  beta_age_low

. rename  se_age_high_   se_age_high

. rename  se_age_low_  se_age_low

. *
. g zero = 0

. local zero = 0 

. *
. global bandwidth = 0.66

. gen beta_bench = 0

. local beta_bench = beta_bench

. 
. g beta_age_high_min = beta_age_high-1.64*se_age_high

. g beta_age_high_max = beta_age_high+1.64*se_age_high

. g beta_age_low_min = beta_age_low-1.64*se_age_low

. g beta_age_low_max = beta_age_low+1.64*se_age_low

.                                 
. label define experience 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7+" 8 "8" 9 "9" 10 "10"

. label values experience experience

. label list
experience:
           2 2
           3 3
           4 4
           5 5
           6 6
           7 7+
           8 8
           9 9
          10 10

. label var beta_age_high "High uncertainty"

. label var beta_age_low  "Low uncertainty"

. *
. twoway rarea  beta_age_low_min beta_age_low_max experience,  fintensity(inten30) bsty(ci) sort  xlabel(2 3 4 5 6 7 8 9 10,  valuelabel) ///
> || scatter beta_age_low experience, scheme(s2gmanual) lpattern(dash)  msymbol(O) c(l) xtitle("# years since last entry") ///
> || rarea  beta_age_high_min beta_age_high_max experience,  fintensity(inten30) bsty(ci) sort  xlabel(2 3 4 5 6 7 8 9 10,  valuelabel) ///
> || scatter beta_age_high experience,   msymbol(O) c(l) xtitle("# years since last entry") ///
> title("Belief updating", pos(11) ring(0) size(medium)) legend(on order(2 4)) bgcolor(white) graphregion(color(white)) ysize(4) xsize(4) scale(0.8)

. graph export $results\Figure_A4.eps, as(eps) replace
(note: file results\Figure_A4.eps not found)
(file results\Figure_A4.eps written in EPS format)

. 
. 
. erase "$Output\sd_res_jk.dta"

. 
. log close
      name:  <unnamed>
       log:  D:\Vicard\VV\re\inprogress\BRV\results\Table3.log
  log type:  text
 closed on:  29 Sep 2017, 17:26:56
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
